package com.wangshouyu.mp.media;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import com.wangshouyu.mp.base.response.BaseResponse;

import java.util.Objects;

/**
 * @author 王守钰
 * @date 2020年12月22日 16:04
 * @description 素材信息
 */
public class MediaInfo extends BaseResponse {

    /**
     * 素材类型
     */
    private String type;

    /**
     * 素材id
     */
    @SerializedName(value = "media_id")
    @JsonProperty(value = "media_id")
    @JSONField(name = "media_id")
    private String mediaId;

    /**
     * 创建时间
     */
    @SerializedName(value = "created_at")
    @JsonProperty(value = "created_at")
    @JSONField(name = "created_at")
    private Long createAt ;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getMediaId() {
        return mediaId;
    }

    public void setMediaId(String mediaId) {
        this.mediaId = mediaId;
    }

    public Long getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Long createAt) {
        this.createAt = createAt;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        MediaInfo mediaInfo = (MediaInfo) o;
        return Objects.equals(type, mediaInfo.type) && Objects.equals(mediaId, mediaInfo.mediaId) && Objects.equals(createAt, mediaInfo.createAt);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), type, mediaId, createAt);
    }

    @Override
    public String toString() {
        return "MediaInfo{" +
                "type='" + type + '\'' +
                ", mediaId='" + mediaId + '\'' +
                ", createAt=" + createAt +
                '}';
    }
}
